#include <iostream>

#include "ArrayTests.h"
#include "AutoPtrTests.h"
#include "ListTests.h"
#include "RegistryTests.h"
#include "SharedPtrTests.h"
#include "StringTests.h"
#include "VectorTests.h"
#include "StackTests.h"

void WaitForInput()
{
    std::cout << std::endl << "Press Enter to continue...";
    getchar();
}

void FillTestsList(TestFramework::TestManager& manager)
{
    manager.AddTest(Tests::CreateArrayTester());
    manager.AddTest(Tests::CreateAutoPtrTester());
    manager.AddTest(Tests::CreateListTester());
    manager.AddTest(Tests::CreateRegistryTester());
    manager.AddTest(Tests::CreateSharedPtrTester());
    manager.AddTest(Tests::CreateStackTester());
    manager.AddTest(Tests::CreateStringTester());
    manager.AddTest(Tests::CreateVectorTester());
}

int main(int argc, char* argv[])
{
    try
    {
        TestFramework::TestManager manager;
        FillTestsList(manager);
        manager.RunTests();
        manager.ShowResultSummary();
    }
    catch (const std::exception& error)
    {
        std::cout << std::endl << error.what() << std::endl;
        WaitForInput();
        return 1;
    }

    WaitForInput();
    return 0;
}
